package Object类;

/*
 * person类默认继承了object类，所以可以使用Object类中的equals方法
 * */
public class Equals {
    public static void main(String[] args) {
        PersonForEquals one = new PersonForEquals("lee", 20);
        PersonForEquals two = new PersonForEquals("lee", 20);
       // boolean a = one.equals(two);
       // System.out.println(a);
        System.out.println("one:" + one);
        System.out.println("two:" + two);

        boolean b = one.equals(two);
        System.out.println(b);
        one = two;
        System.out.println("one:" + one);
        System.out.println("two:" + two);
    }
}
